<%--
 * list.jsp
 *
 * Copyright (C) 2013 Universidad de Sevilla
 * 
 * The use of this project is hereby constrained to the conditions of the 
 * TDG Licence, a copy of which you may download from 
 * http://www.tdg-seville.info/License.html
 --%>

<%@page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="security"
	uri="http://www.springframework.org/security/tags"%>
<%@taglib prefix="display" uri="http://displaytag.sf.net"%>

<display:table pagesize="5" class="displaytag" keepStatus="true"
	name="challenges" requestURI="${requestURI}" id="row">


	<!-- Attributes -->

	<spring:message code="challenge.title" var="titleHeader" />
	<display:column property="title" title="${titleHeader}" sortable="true" />

	<spring:message code="challenge.description" var="descriptionHeader" />
	<display:column property="description" title="${descriptionHeader}"
		sortable="true" />

	<spring:message code="challenge.result" var="resultHeader" />
	<display:column property="result" title="${resultHeader}"
		sortable="true" />


	<security:authorize access="hasRole('ADMIN')">
		<jstl:if test="${showDetails}">
			<spring:message code="challenge.edit" var="editHeader" />
			<display:column title="${editHeader}" sortable="true">
					<a href="challenge/administrator/edit.do?challengeId=${row.id}">
						<spring:message code="challenge.edit" />
					</a>
			</display:column>
		</jstl:if>
	</security:authorize>

</display:table>

<!-- Action links -->
<security:authorize access="hasRole('ADMIN')">
	<jstl:if test="${showDetails}">
		<jstl:if test="${active}">
		<div>
			<a href="challenge/administrator/create.do?eventId=${eventId}"> <spring:message
					code="challenge.create" />
			</a>
		</div>
	</jstl:if>
	</jstl:if>
</security:authorize>

